/*证书后台*/
'use strict';
const certificateQueryAction = require('../actions/certificate/certificateQueryAction');
const certificateUpdateAction = require('../actions/certificate/certificateUpdateAction');

module.exports = async function (ctx) {
    let param = ctx.method === 'GET' ? ctx.query : ctx.request.fields;
    let action_type = param.action_type;
    try {
        switch (action_type) {
            case 'certificateQuery': // 工程基础信息查询
                ctx.body = await certificateQueryAction(param);
                break;
            case 'certificateUpdate': // 工程基础信息修改
                ctx.body = await certificateUpdateAction(param);
                break;
        }
    } catch (e) {
        ctx.body = {success: false, message: e.message};
    }

};